#2019年省赛-程序设计题 交换瓶子
n = int(input())
a = [0] + list(map(int, input().split()))
ans = 0
for i in range(1, n + 1):
    if a [i] != i:
        b = a.index(i)
        a[i], a[b] = a[b], a[i]
        ans += 1
print(ans)